# @Author   : 懒羊羊
# @File     : first_song.py
# @Time     : 2024/12/11 19:34

import time
from appium.webdriver.common.appiumby import AppiumBy
from pages.basepage import BasePage


class FaXianPage(BasePage):
    fx = (AppiumBy.ID, 'com.kkpodcast:id/find_rb')
    song = (AppiumBy.XPATH, '//*[@resource-id="com.kkpodcast:id/song_sheet_rv"]/android.view.ViewGroup[1]')

    def go_to_song(self):
        time.sleep(5)

        # 滑动页面
        self.d.swipe(800, 1609, 800, 216)

        # 点击第一首歌
        self.getElement(self.song).click()
